/**
 * 錯誤列表
 * @author LuoDong
 * @email luo4521@online.net.tw
 */
package com.addcn.texas.utils
{
	public class MsgTable
	{
		private static var _list : Object = new Array();
		private static var _instance : MsgTable;

		public function MsgTable() : void
		{
			if (_instance != null) {
				throw ("[ErrorTable] 為單例類!");
			}else {
				_initialize();
			}
		}
		
		private static function _initialize() : void
		{
			_list['9999'] = "用戶名和密碼不能為空";
			_list['9998'] = "用戶密碼不能為空";
			_list['9997'] = "不存在該用戶名";
			_list['9996'] = "用戶名或密碼錯誤";
			_list['9995'] = "請先登入";
			_list['9993'] = "已經坐下";
			
			_list["8001"] = "api驗證不成功";
			
			_list["7002"] = '加入房間失敗';
			_list["7004"] = '加入房間密碼錯誤';
			_list["7005"] = '加入房間參數錯誤';
			_list["7007"] = "該座位已經有人坐了";
			_list["7008"] = "您的金幣不足,無法進行游戲";
			
			_list['1003'] = "正在登入,請稍候...";
			_list['1002'] = "連接伺服器失敗";
			_list['1001'] = "與伺服器連接斷開";

		}
		
		public static function getInstance() : MsgTable {
			if ( _instance == null) {				
				_instance = new MsgTable();
			}
			return _instance;
		}
		
		public function msg(r_code : String) : String
		{
			var _msg = MsgTable._list[r_code];
			if (_msg == null) {
				_msg = "未知错误！"
			}
			return _msg;
		}
		
	}
	
}
